<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.5"/>
<title>axipmon: xaxipmon_polled_example.c File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
  $(window).load(resizeHeight);
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="HTML_custom.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="xlogo_bg.png"/></td>
  <td style="padding-left: 0.5em;">
   <div id="projectname">axipmon
   </div>
   <div id="projectbrief">Vitis Drivers API Documentation</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.5 -->
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Overview</span></a></li>
      <li><a href="annotated.html"><span>Data&#160;Structures</span></a></li>
      <li><a href="globals.html"><span>APIs</span></a></li>
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="pages.html"><span>Examples</span></a></li>
    </ul>
  </div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('xaxipmon__polled__example_8c.html','');});
</script>
<div id="doc-content">
<div class="header">
  <div class="summary">
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">xaxipmon_polled_example.c File Reference</div>  </div>
</div><!--header-->
<div class="contents">
<a name="details" id="details"></a><h2 class="groupheader">Overview</h2>
<div class="textblock"><p>This file contains a design example showing how to use the driver APIs of the AXI Performance Monitor driver in poll mode. </p>
<dl class="section note"><dt>Note</dt><dd></dd></dl>
<p>Global Clock Counter and Metric Counters are enabled. The Application for which Metrics need to be computed should be run and then the Metrics collected.</p>
<pre></pre><pre>MODIFICATION HISTORY:</pre><pre>Ver   Who    Date     Changes
</p>
<hr/>
<p>
1.00a bss    02/29/12 First release
2.00a bss    06/23/12 Updated to support v2_00a version of IP.
3.00a bss    09/03/12 Deleted XAxiPmon_SetAgent API to support
                                        v2_01a version of IP.
3.01a bss          10/25/12 Deleted XAxiPmon_EnableCountersData API to support
                                        new version of IP.
6.5   ms    01/23/17 Modified xil_printf statement in main function to
                     ensure that "Successfully ran" and "Failed" strings are
                     available in all examples. This is a fix for CR-965028.
6.10  ht    06/23/23 Added support for system device-tree flow.
</pre> </div><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:ab2c40b15cc639d2e0f28145feab340ae"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xaxipmon__polled__example_8c.html#ab2c40b15cc639d2e0f28145feab340ae">AxiPmonPolledExample</a> (u16 AxiPmonDeviceId, u32 *Metrics, u32 *ClkCntHigh, u32 *ClkCntLow)</td></tr>
<tr class="memdesc:ab2c40b15cc639d2e0f28145feab340ae"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function runs a test on the AXI Performance Monitor device using the driver APIs.  <a href="#ab2c40b15cc639d2e0f28145feab340ae">More...</a><br/></td></tr>
<tr class="separator:ab2c40b15cc639d2e0f28145feab340ae"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a840291bc02cba5474a4cb46a9b9566fe"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xaxipmon__polled__example_8c.html#a840291bc02cba5474a4cb46a9b9566fe">main</a> (void)</td></tr>
<tr class="memdesc:a840291bc02cba5474a4cb46a9b9566fe"><td class="mdescLeft">&#160;</td><td class="mdescRight">Main function that invokes the example in this file.  <a href="#a840291bc02cba5474a4cb46a9b9566fe">More...</a><br/></td></tr>
<tr class="separator:a840291bc02cba5474a4cb46a9b9566fe"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">Function Documentation</h2>
<a class="anchor" id="ab2c40b15cc639d2e0f28145feab340ae"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int AxiPmonPolledExample </td>
          <td>(</td>
          <td class="paramtype">u16&#160;</td>
          <td class="paramname"><em>AxiPmonDeviceId</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u32 *&#160;</td>
          <td class="paramname"><em>Metrics</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u32 *&#160;</td>
          <td class="paramname"><em>ClkCntHigh</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u32 *&#160;</td>
          <td class="paramname"><em>ClkCntLow</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function runs a test on the AXI Performance Monitor device using the driver APIs. </p>
<p>This function does the following tasks:</p>
<ul>
<li>Initiate the AXI Performance Monitor device driver instance</li>
<li>Run self-test on the device</li>
<li>Sets Metric Selector to select Slave Agent Number 1 and first set of Metrics</li>
<li>Enables Global Clock Counter and Metric Counters</li>
<li>Calls Application for which Metrics need to be computed</li>
<li>Disables Global Clock Counter and Metric Counters</li>
<li>Read Global Clock Counter and Metric Counter 0</li>
</ul>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">AxiPmonDeviceId</td><td>is the XPAR_&lt;AXIPMON_instance&gt;_DEVICE_ID value from xparameters.h. </td></tr>
    <tr><td class="paramname">Metrics</td><td>is an user referece variable in which computed metrics will be filled </td></tr>
    <tr><td class="paramname">ClkCntHigh</td><td>is an user referece variable in which Higher 64 bits of Global Clock Counter are filled </td></tr>
    <tr><td class="paramname">ClkCntLow</td><td>is an user referece variable in which Lower 64 bits of Global Clock Counter are filled</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><ul>
<li>XST_SUCCESS if the example has completed successfully.</li>
<li>XST_FAILURE if the example has failed.</li>
</ul>
</dd></dl>
<dl class="section note"><dt>Note</dt><dd>None </dd></dl>

<p>References <a class="el" href="struct_x_axi_pmon___config.html#aaaf3e726cc3af1648c88b8a3052252db">XAxiPmon_Config::BaseAddress</a>, <a class="el" href="group__axipmon.html#ga100cefd307b44e6bd50767efc4105599">XAPM_INCREMENTER_0</a>, <a class="el" href="group__axipmon.html#ga1f34457ef45ca60383e42a52d173d498">XAPM_METRIC_COUNTER_0</a>, <a class="el" href="group__axipmon.html#ga345d7613d04158d0c726d87020dc9d46">XAPM_METRIC_SET_0</a>, <a class="el" href="group__axipmon.html#gafc3c070e08d80f970b4e84c74ca6b37e">XAxiPmon_CfgInitialize()</a>, <a class="el" href="group__axipmon.html#ga5dc44c73c583941ec4a86f2a1485ddcc">XAxiPmon_DisableGlobalClkCounter</a>, <a class="el" href="group__axipmon.html#ga339b500e3f165daf5b7b8f943eee0437">XAxiPmon_DisableMetricsCounter()</a>, <a class="el" href="group__axipmon.html#ga1c5252b8769578c0f33ef9e4cbb012b7">XAxiPmon_EnableGlobalClkCounter</a>, <a class="el" href="group__axipmon.html#ga12595840082105ce722b8b36d910443a">XAxiPmon_EnableMetricsCounter()</a>, <a class="el" href="group__axipmon.html#ga833edad9f6bdc75777eca3247940931f">XAxiPmon_GetGlobalClkCounter()</a>, <a class="el" href="group__axipmon.html#ga5450238f0ff52df5a447c26199e9dd4d">XAxiPmon_GetMetricCounter()</a>, <a class="el" href="group__axipmon.html#ga93ed0a2b99a2e74dc0da62ed674fd2bb">XAxiPmon_LookupConfig()</a>, <a class="el" href="group__axipmon.html#ga5d9aca319722f5632647d1d08931382c">XAxiPmon_SelfTest()</a>, <a class="el" href="group__axipmon.html#gad07bb2139c9b16d6f46f49b02b0200ae">XAxiPmon_SetIncrementerRange()</a>, and <a class="el" href="group__axipmon.html#gaa14a3b36f2558ecbc47d81d4b3c3fd9d">XAxiPmon_SetMetrics()</a>.</p>

<p>Referenced by <a class="el" href="xaxipmon__polled__example_8c.html#a840291bc02cba5474a4cb46a9b9566fe">main()</a>.</p>

</div>
</div>
<a class="anchor" id="a840291bc02cba5474a4cb46a9b9566fe"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int main </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Main function that invokes the example in this file. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">None.</td><td></td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><ul>
<li>XST_SUCCESS if the example has completed successfully.</li>
<li>XST_FAILURE if the example has failed.</li>
</ul>
</dd></dl>
<dl class="section note"><dt>Note</dt><dd>None. </dd></dl>

<p>References <a class="el" href="xaxipmon__polled__example_8c.html#ab2c40b15cc639d2e0f28145feab340ae">AxiPmonPolledExample()</a>.</p>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
	<p class="footer">&copy; Copyright 2015-2022 Xilinx, Inc. All Rights Reserved.</p>
	<p class="footer">&copy; Copyright 2022-2023 Advanced Micro Devices, Inc. All Rights Reserved.</p>
</div>
</body>
</html>
